<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/css/cart.css}">
    <script language="JavaScript" th:src="@{/script/cart.js}"></script>
</head>
<body>

        <div class="container">
            <h1>我的购物车</h1>
            <table class="table" Cellspacing="0" >

                <thead>
                    <tr>
                        <th style="width: 8%">
                            <input type="checkbox" value="哈密瓜" name="shopping"/>全选
                        </th>
                        <th style="width: 32%">商品</th>
                        <th style="width: 12%">单价</th>
                        <th style="width: 12%">数量</th>
                        <th style="width: 12%">小计</th>
                        <th style="width: 12%">操作</th>
                    </tr>
                </thead>

                <tbody>
                    <tr th:each="cartItem:${cartInfo.getCartItemMap().values()}" th:object="${cartItem}">
                        <td>
                            <input type="checkbox" value="哈密瓜" name="shopping"/>
                        </td>
                        <td>
                            <img class="cart_img" th:src="@{|/userImg/*{product.getProductImg()}|}" th:text="*{product.getProductName()}"/>
                        </td>
                        <td th:text="*{product.productPrice}">20</td>
                        <td>
                            <span class="count" th:onclick="@{|edit(*{cartItemId},*{cartItemNum-1})|}">-</span>
                            <input class="count-num" type="text" th:value="*{cartItemNum}"/>
                            <span class="count" th:onclick="@{|edit(*{cartItemId},*{cartItemNum+1})|}">+</span>
                        </td>
                        <td th:text="*{product.productPrice*cartItemNum}">60</td>
                        <td><a th:href="@{|/cart/delCartItem/*{cartItemId}|}">删除</a></td>
                    </tr>
                </tbody>

                <div class="footer">
                    <div class="footer-left">
                        <a href="#" class="clear-cart" th:onclick="clearCart()">清空购物车</a>
                        <a th:href="@{|/page/${1}/${session.user.getUserId()}|}">继续购物</a>
                    </div>
                    <div class="footer-right">
                        <div>共<span th:text="${cartInfo.getTotalProductCount()}">0</span>件商品</div>
                        <div class="total-price">总金额<span th:text="${cartInfo.getTotalMoney()}">0</span>元</div>
                        <a class="pay" th:href="@{/cart/payall}">去结账</a>
                    </div>
                </div>

            </table>
        </div>
</body>
</html>